




















































<html>
<head>
<title>Login page for STB</title>
                      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>


    <script language="javascript">
/* java变量与js 变量转换*/
var isSucessed = true;
var isWriteBox = true;
var needWriteTSP = false;
function AuthFinish()
{
  /* 认证成功才写入 */
  var tempKey = "";
  if (isSucessed)
  {
    Utility.setValueByName('Tools.Record.AddRecord','{"key":"X_CSRFToken","value":"null","type":"1"}');
    if (false)
    {
      Utility.setValueByName('authStatus','{"status":"1","errorCode":"","errorType":"","errorName":"","errorDesc":"","errorResolve":""}');
      Utility.setValueByName('TVDesktopID','');
      Utility.setValueByName('TVDesktopGetURL','');
      // 智能机顶盒容灾情况下也下发UserToken，否则无法获取桌面数据
      if (!isWriteBox)
      {
        Authentication.CTCSetConfig('UserToken','8J0fs8J0fs065ZO8UVZf7sD10YgpgwEx');
      }
    }

    Authentication.CTCSetConfig('IsPostLog','0');

    setStbParmList();

    Authentication.CTCSetConfig('SQARtcpPort','8027');

    Authentication.CTCSetConfig('UserToken','8J0fs8J0fs065ZO8UVZf7sD10YgpgwEx');
    Authentication.CTCSetConfig('EPGDomain','http://117.187.176.100:33200/EPG/jsp/default03/en/Category.jsp');
    /* 容灾状态这些值没必要再下发给盒子了*/
    if (isWriteBox)
    {
      Authentication.CTCSetConfig('EPGDomainBackup','null');
      Authentication.CTCSetConfig('ManagementDomain','http://117.187.220.91:37020/acs');
      Authentication.CTCSetConfig('ManagementDomainBackup','null');
      Authentication.CTCSetConfig('UpgradeDomain','www.www.www');
      Authentication.CTCSetConfig('UpgradeDomainBackup','null');
      Authentication.CTCSetConfig('NTPDomain','iptvntp.gz.chinamobile.com');
      Authentication.CTCSetConfig('NTPDomainBackup','iptvntp.gz.chinamobile.com');
      Authentication.CTCSetConfig('EPGGroupNMB','default03');
      Authentication.CTCSetConfig('UserGroupNMB','10');
      Authentication.CTCSetConfig('PackageIDs','');
      Authentication.CTCSetConfig('subNetId','8601');

      if (false)
      {
        if (false)
        {
          Authentication.CTCSetConfig('NetUserID','null');
        }
      }

      Authentication.CTCSetConfig('areaid','850');
      Authentication.CTCSetConfig('templateName','default03');
    }

    Authentication.CTCSetConfig('shareKey','null');
    Authentication.CTCSetConfig('LogServerUrl','sftp://username:***@IP:port/path');
    Authentication.CTCSetConfig('LogUploadInterval','3600');
    Authentication.CTCSetConfig('LogRecordInterval','3600');
    Authentication.CTCSetConfig('EPGUrl','http://117.187.176.100:33200/EPG/jsp/indexHWCTC.jsp');
    Utility.setValueByName('novelDRMServerUrl', 'null');

    //写用户认证通过标志
    Authentication.CTCSetConfig('UserStatus','1');

    if (needWriteTSP)
    {
      Authentication.CTCSetConfig('TransportProtocol','-1');
    }

    Authentication.CTCSetConfig('MQMCURL','117.187.220.170');
    //认证成功后,非空的PPPoE才写入机顶盒. 只能放在最后写入,详见问题单

    setSTBConfig();

    Authentication.CTCSetConfig('SessionID','0212RYK06VMBCB3XI0J5XL28SPPI5CIV');

    tempKey = Authentication.CTCGetConfig('identityEncode');
    document.authform.tempKey.value = tempKey;
  }

  document.authform.submit();
}

function setSTBConfig()
{
  Authentication.CTCSetConfig('UserID','cwtest00');
  Authentication.CTCSetConfig('TVMSHeartbitUrl','http://www.TVMSHeartbitUrl.com');
  Authentication.CTCSetConfig('TVMSVODHeartbitUrl','http://www.TVMSVODHeartbitUrl.com');
  Authentication.CTCSetConfig('TVMSHeartbitInterval','600');
  Authentication.CTCSetConfig('TVMSDelayLength','60');
  Authentication.CTCSetConfig("ResServerUrl", "www.www.www" + "/EDS/jsp/loadBootpic.jsp");

  setBootPic();

  Authentication.CTCStartUpdate();
}

function getUrlParameter(url, paramtername)
{
  var name = paramtername +"=";
  var value =url.substring(url.indexOf(name) + name.length);
  if (value.indexOf("&") != -1){
    value =value.substring(0, value.indexOf("&"));
  }
  //console.log(paramtername +"= " +value);
  return value;
}

function setBootPic()
{
  //下发开机画面
  var bootLogo = "http://www.www.www/EDS/jsp/loadBootpic.jsp?STBType=E900V21E&areaid=10003&PicType=0&userId=cwtest00&userGroupId=10&isIndiv=1";
  var authenBack = "http://www.www.www/EDS/jsp/loadBootpic.jsp?STBType=E900V21E&areaid=10003&PicType=1&userId=cwtest00&userGroupId=10&isIndiv=1";
  var bootLoad = "null";
  var bootAny = "http://www.www.www/EDS/jsp/loadBootpic.jsp?STBType=E900V21E&areaid=10003&PicType=3&userId=cwtest00&userGroupId=10&isIndiv=1";
  var bootLogo_old = Authentication.CTCGetConfig("PADBootLogPicURL");
  var authenBack_old = Authentication.CTCGetConfig("PADAuthenBackgroundPicURL");
  var bootLoad_old = Authentication.CTCGetConfig("PADLoaderLogoPicURL");
  var bootAny_old = Authentication.CTCGetConfig("BootanimationURL");
  var isSupportAD = "0";

  //对接广告平台时
  if (1 == isSupportAD)
  {
    if (bootLogo != '' && bootLogo != 'null')
    {
      if (bootLogo != bootLogo_old)
      {
        Authentication.CTCSetConfig("PADBootLogPicURL", bootLogo);
      }
    }
    if (authenBack != '' && authenBack != 'null')
    {
      if (authenBack != authenBack_old)
      {
        Authentication.CTCSetConfig("PADAuthenBackgroundPicURL", authenBack);
      }
    }
  }
  //个性化开机画面流程
  else
  {

    var sJson= Authentication.CTCGetConfig('commonInfo, {"type":"bootPic"}');
    if (sJson.downLoadURL != "http://www.www.www/EDS/jsp/loadBootpic.jsp?STBType=E900V21E&areaid=10003&PicType=5&userId=cwtest00&userGroupId=10&isIndiv=1")
    {
      Authentication.CTCSetConfig('commonInfo','{"type":"bootPic","downLoadURL":"http://www.www.www/EDS/jsp/loadBootpic.jsp?STBType=E900V21E&areaid=10003&PicType=5&userId=cwtest00&userGroupId=10&isIndiv=1","infoDesc":""}');
    }

    var sJson= Authentication.CTCGetConfig('commonInfo, {"type":"fastPlay"}');
    if (sJson.downLoadURL != "http://www.www.www/EDS/jsp/loadBootpic.jsp?STBType=E900V21E&areaid=10003&PicType=6&userId=cwtest00&userGroupId=10&isIndiv=1")
    {
      Authentication.CTCSetConfig('commonInfo','{"type":"fastPlay","downLoadURL":"http://www.www.www/EDS/jsp/loadBootpic.jsp?STBType=E900V21E&areaid=10003&PicType=6&userId=cwtest00&userGroupId=10&isIndiv=1","infoDesc":""}');
    }

    var sJson= Authentication.CTCGetConfig('commonInfo, {"type":"bootanimation"}');
    if (sJson.downLoadURL != "http://www.www.www/EDS/jsp/loadBootpic.jsp?STBType=E900V21E&areaid=10003&PicType=7&userId=cwtest00&userGroupId=10&isIndiv=1")
    {
      Authentication.CTCSetConfig('commonInfo','{"type":"bootanimation","downLoadURL":"http://www.www.www/EDS/jsp/loadBootpic.jsp?STBType=E900V21E&areaid=10003&PicType=7&userId=cwtest00&userGroupId=10&isIndiv=1","infoDesc":""}');
    }

    var sJson= Authentication.CTCGetConfig('commonInfo, {"type":"authPic"}');
    if (sJson.downLoadURL != "http://www.www.www/EDS/jsp/loadBootpic.jsp?STBType=E900V21E&areaid=10003&PicType=8&userId=cwtest00&userGroupId=10&isIndiv=1")
    {
      Authentication.CTCSetConfig('commonInfo','{"type":"authPic","downLoadURL":"http://www.www.www/EDS/jsp/loadBootpic.jsp?STBType=E900V21E&areaid=10003&PicType=8&userId=cwtest00&userGroupId=10&isIndiv=1","infoDesc":""}');
    }


    if (bootLogo != '' && bootLogo != 'null')
    {
      if (-1 == bootLogo.indexOf("FILENAME=") || undefined == bootLogo_old || -1 == bootLogo_old.indexOf("FILENAME="))
      {
        //如果不带FILENAME字段说明EPG没有匹配到策略，这时再发请求在UPG端再进行匹配
        Authentication.CTCSetConfig("PADBootLogPicURL", bootLogo);
      }
      else
      {
        //截取出filename进行比较
        var bootLogo_filename = getUrlParameter(bootLogo, "FILENAME");
        var bootLogo_old_filename = getUrlParameter(bootLogo_old, "FILENAME");
        if (bootLogo_filename != bootLogo_old_filename)
        {
          Authentication.CTCSetConfig("PADBootLogPicURL", bootLogo);
        }
      }
    }

    if (authenBack != '' && authenBack != 'null')
    {
      if (-1 == authenBack.indexOf("FILENAME=") || undefined == authenBack_old || -1 == authenBack_old.indexOf("FILENAME="))
      {
        Authentication.CTCSetConfig("PADAuthenBackgroundPicURL", authenBack);
      }
      else
      {
        //截取出filename进行比较
        var authenBack_filename = getUrlParameter(authenBack, "FILENAME");
        var authenBack_old_filename = getUrlParameter(authenBack_old, "FILENAME");
        if (authenBack_filename != authenBack_old_filename)
        {
          Authentication.CTCSetConfig("PADAuthenBackgroundPicURL", authenBack);
        }
      }
    }

    if (bootLoad != '' && bootLoad != 'null')
    {
      if (-1 == bootLoad.indexOf("FILENAME=") || undefined == bootLoad_old ||  -1 == bootLoad_old.indexOf("FILENAME="))
      {
        Authentication.CTCSetConfig("PADLoaderLogoPicURL", bootLoad);
      }
      else
      {
        //截取出filename进行比较
        var bootLoad_filename = getUrlParameter(bootLoad, "FILENAME");
        var bootLoad_old_filename = getUrlParameter(bootLoad_old, "FILENAME");
        if (bootLoad_filename != bootLoad_old_filename)
        {
          Authentication.CTCSetConfig("PADLoaderLogoPicURL", bootLoad);
        }
      }
    }

    if (bootAny != '' && bootAny != 'null')
    {
      if (-1 == bootAny.indexOf("FILENAME=") || undefined == bootAny_old ||  -1 == bootAny_old.indexOf("FILENAME="))
      {
        Authentication.CTCSetConfig("BootanimationURL", bootAny);
      }
      else
      {
        //截取出filename进行比较
        var bootAny_filename = getUrlParameter(bootAny, "FILENAME");
        var bootAny_old_filename = getUrlParameter(bootAny_old, "FILENAME");
        if (bootAny_filename != bootAny_old_filename)
        {
          Authentication.CTCSetConfig("BootanimationURL", bootAny);
        }
      }
    }
  }
}

function setStbParmList()
{

}
</script>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="transparent" onload="AuthFinish()">
    <table width="640" height="340" border="0">
    <tr>
    <td width="640" height="300"></td>
    </tr>
    <tr>
    </tr>
    </table>
    <form action="getchannellistHWCTC.jsp" name="authform" method="post">
    <input type="hidden" name="conntype" value="dhcp">
    <input type="hidden" name="UserToken" value="8J0fs8J0fs065ZO8UVZf7sD10YgpgwEx">
    <input type="hidden" name="tempKey" value="">
    <input type="hidden" name="stbid" value="000019">
    <input type="hidden" name="SupportHD" value="1">
    <input type="hidden" name="UserID" value="cwtest00">
    <input type="hidden" name="Lang" value="1">
    </form>
    </body>
    </html>
